<?php

/**
 * Description of Connection
 *
 * @author Hashan
 */
class Connection {

    //Constructor call in the Connection class: Creates an Object of the connection with the selected DB
    function  __construct() {
        $this->conn = mysql_connect('localhost', 'root', '') or die ('Error connecting to mysql');
        mysql_select_db('group_2006_i', $this->conn);
    }

    /// Param: $sqlQuery(The SQL Query that neds to be executed)
    /// Return: A Results set of the executed query or Query Fail on Bad Query
    public function query($sqlQuery) {
        //echo $sqlQuery;
        $this->result = mysql_query($sqlQuery) or die ("Query Fail [".$sqlQuery."] :" . mysql_error());
        return $this->result;
    }
}

?>
